<?php
class cgClassAction extends Action
{

	/**
	 * 检测执行采购审批是否可以看流程处理记录
	 */
	public function checkCgspIscanShowAjax(){
        $adminid = $this->request("adminid");
        $adminEntry = m("admin")->getone("id=".$adminid);
        $msg = "1";
        if ($adminEntry) {
            if ($adminEntry["ranking"] == "代理机构" || $adminEntry["ranking"] == "律师") {
                $msg = "0";
            }
        }else {
            $msg = "没有查到对应账号";
        }
        $this->backmsg($msg);
	}
	
    /**
     * 获取附件信息
     */
    public function getFilesAjax()
    {
        $ids = $this->request('ids');
        if(empty($ids)) $this->backmsg('数据为空');
        $data = m('file')->getstr('', '', 3, "id in (".$ids.")");
        $this->backmsg('', 'success', $data);
    }

    public function testAjax() {
        //开启调试模式
        define('APP_DEBUG', true);
        //包含自动加载类
        require './vendor/autoload.php';
        //smarty实例化
        $smarty = new \Smarty;
        //$smarty->left_delimiter = "{#";
        //$smarty->right_delimiter = "#}";
        $smarty->setTemplateDir(ROOT_PATH . '/views/'); //设置模板目录
        $smarty->setCompileDir(ROOT_PATH . '/upload/cache/templates_c/');
//        $smarty->setConfigDir(ROOT_PATH . '/views/smarty_configs/');
        $smarty->setCacheDir(ROOT_PATH . '/upload/cache/smarty_cache/');
        //$smarty->force_compile = true;
        if (APP_DEBUG) {
            //$smarty->debugging      = true;
            $smarty->caching        = false;
            $smarty->cache_lifetime = 0;
        } else {
            //$smarty->debugging      = false;
            $smarty->caching        = true;
            $smarty->cache_lifetime = 120;
        }
        $smarty->assign('data', array('name' => '体育总会', 'icp' => '内财购备字[2019]10463号'));
        $smarty->display('index.html');
    }
}